<%@ taglib prefix="color" uri="http://www.springframework.org/tags/form" %>
<%
    String contextPath = request.getContextPath();
    request.setAttribute("contextPath",contextPath);
%>
<%--
  Created by IntelliJ IDEA.
  User: 245167
  Date: 2017/8/14
  Time: 11:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<style>
    .col-center-block {
        float: none;
        display: block;
        margin-left: 33%;
        margin-top: 5%;
        border:1px solid rgba(223, 208, 181, 0.7);
        -webkit-box-shadow:0 0 10px 10px rgba(145, 132, 110, 0.9);
        -moz-box-shadow:0 0 10px 1px rgba(145, 132, 110, 0.9);
        box-shadow:0 0 10px 1px rgba(145, 132, 110, 0.9);
    }
</style>
<head>
    <title>晴宝</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static-resources/bootstrap/css/bootstrap.min.css"/>
    <link rel="icon" href="${pageContext.request.contextPath}/static-resources/assets/images/skype.ico" type="image/x-icon">
<%--   <script  type="text/javascript" src="${pageContext.request.contextPath}/WEB-INF/js/index.js"></script>--%>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static-resources/js/jquery.min.js"></script>
    <script type="text/javascript"
            src="${pageContext.request.contextPath}/static-resources/bootstrap/js/bootstrap.min.js?122"></script>
    <script type="text/javascript">
        function login() {
            debugger;
            var username = $("#inputUsername").val();
            var password = $("#inputPassword").val();
            if(null == username || username == "undefined" || username =="" || username == "邮箱账号或手机号" ){
                $("#warning").text("账号不能为空");
                $("#inputUsername").hide();
                return false;
            }else{
                // 可以使用el表达式校验手机号和邮箱号的格式
            }
            if(null == password || password == "undefined" || password =="" || password == "邮箱账号或手机号" ){
                $("#warning").text("账号不能为空");
                $("#password").hide();
                return false;
            }
            $("#warning").text("");
            var postData = {"loginUsername":username,"loginPassword":password};
            $.post("${pageContext.request.contextPath}/login/doLogin.do", postData);
        }

        //    $(document).ready(function(){
        //        $("#zyf001").click(function(){
        //            alert("7098707777770");//使用
        //        });
        //    });
    </script>
</head>
<body style="background: url(./static-resources/assets/images/picture03.png) no-repeat;">
<h1 align="center" style="padding-top: 10%;font-size: 50px;font-weight:bold;">晴宝博客系统</h1>
<div class="container">
    <div class="row myCenter">
        <div class="col-xs-6 col-md-4 col-center-block">
            <form class="form-horizontal" role="form" post="">
                <br>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="inputUsername" style="font-family:STSong;font-size: 16px">
                        账&nbsp;号&nbsp;:</label>
                    <div class="col-sm-10 controls">
                        <input type="text" class="form-control" id="inputUsername" name="username" placeholder="邮箱账号或手机号"
                               style="font-family:Microsoft YaHei;font-size: 12px;">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="inputPassword" style="font-family:STSong;font-size: 16px">密&nbsp;码&nbsp;:</label>
                    <div class="col-sm-10 controls">
                        <input type="password" class="form-control" id="inputPassword" name="password" placeholder="请输入密码"
                               style="font-family:Microsoft YaHei;font-size: 12px;">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <br>
                        <div class="form-inline">
                        <label style="font-family:Microsoft YaHei;font-size: 12px">
                            <input type="checkbox">记住密码
                        </label>
                        <a align="right"
                           style="text-decoration:underline;padding-left: 155px;font-family:Microsoft YaHei;font-size: 10px;"
                           href="123">忘记密码？</a>
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <button  class="btn btn-sm btn-primary" type="button"
                            style="font-family:Microsoft YaHei;margin-left: 75px;" onclick="login()">登录
                    </button>
                    <button  class="btn btn-sm" type="button"
                            style="font-family:Microsoft YaHei;margin-left: 100px;border: 1px solid rgba(0, 0, 0, 0.33);">去注册
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>



<%--
    <script>
    window.onload=function(){
        var a = document.getElementById("index");//获取div块对象
        var Height=document.documentElement.clientHeight;//取得浏览器页面可视区域的宽度
        var Width=document.documentElement.clientWidth;//取得浏览器页面可视区域的宽度
        var gao1 = a.offsetHeight;//获取div块的高度值
        var gao2 = a.offsetWidth;//获取div块的宽度值
        var Sgao1= (Height - gao1)/2+"px";
        var Sgao2= (Width - gao2)/2+"px";
        a.style.top=Sgao1;
        a.style.left=Sgao2;
        alert("页面加载完毕！");
    }
</script>--%>

</body>
</html>
